package com.sita.tboard.roadtrust.detail;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v4.content.CursorLoader;

import com.sita.bike.persistence.RtNoteEntityDao;
import com.sita.bike.support.GlobalContext;

/**
 * Created by xiaodong on 16/3/28.
 */
public class RtNoteCursorLoader extends CursorLoader {
    public RtNoteCursorLoader(Context context) {
        super(context);

    }

    public Cursor loadInBackground() {
        SQLiteDatabase db = GlobalContext.getDaoSession().getDatabase();
        return db.query(RtNoteEntityDao.TABLENAME, null, null, null, null, null, RtNoteEntityDao.Properties.CreateTime.columnName + " desc");
    }
}
